home *** CD-ROM | disk | FTP | other *** search
/ Risc World 7 / Risc World 7.iso / Software / Issue4 / IYONIX / MANICMINER / SOURCE.ZIP / manicminer-1.6.3 / gfxlibs / allegro / c / gfx next >
Encoding:
Text File  |  2000-12-01  |  1.6 KB  |  83 lines

  1. #include "../../manic.h"
  2. #include "common.h"
  3. #include "../gfx.h"
  4.  
  5. void
  6. mm_gfx_putpixel (uint_fast16_t x, uint_fast16_t y, uint_fast8_t col)
  7. {
  8.   putpixel (buffer, x + xoffset, y + yoffset, col);
  9. }
  10.  
  11. void
  12. mm_gfx_putpixel2 (uint_fast16_t x, uint_fast16_t y, uint_fast8_t col)
  13. {
  14.   putpixel (buffer, x, y, col);
  15. }
  16.  
  17. uint_fast8_t
  18. mm_gfx_getpixel (uint_fast16_t x, uint_fast16_t y)
  19. {
  20.   return (getpixel (buffer, x + xoffset, y + yoffset));
  21. }
  22.  
  23. uint_fast8_t
  24. mm_gfx_getpixel2 (uint_fast16_t x, uint_fast16_t y)
  25. {
  26.   return (getpixel (buffer, x, y));
  27. }
  28.  
  29. void
  30. mm_gfx_cls (uint_fast8_t col)
  31. {
  32.   clear_to_color (buffer, col);
  33. }
  34.  
  35. void
  36. mm_gfx_flush (void)
  37. {
  38.   mm_gfx_waitvr ();
  39.   if (DoubleSize)
  40.     stretch_blit (buffer, screen, 0, 0, scrnwidth, scrnheight,
  41.                   0, 0, SCREEN_W, SCREEN_H);
  42.   else
  43.     blit (buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
  44. }
  45.  
  46. void
  47. mm_gfx_waitvr (void)
  48. {
  49.   vsync ();
  50. }
  51.  
  52. void
  53. mm_gfx_fillbox (uint_fast16_t xpos, uint_fast16_t ypos,
  54.         uint_fast16_t width, uint_fast16_t height, uint_fast8_t col)
  55. {
  56.   rectfill (buffer, xpos + xoffset, ypos + yoffset,
  57.         xpos + xoffset + width - 1, ypos + yoffset + height - 1, col);
  58. }
  59.  
  60. void
  61. mm_gfx_fillbox2 (const uint_fast16_t xpos, const uint_fast16_t ypos,
  62.          const uint_fast16_t width, const uint_fast16_t height,
  63.          const uint_fast8_t col)
  64. {
  65.   rectfill (buffer, xpos, ypos, xpos + width - 1, ypos + height - 1, col);
  66. }
  67.  
  68. void
  69. mm_gfx_palset (uint_least8_t * palette)
  70. {
  71.   PALETTE allegpal;
  72.  
  73.   int_fast16_t i;
  74.  
  75.   for (i = 0; i < 256; i++) {
  76.     allegpal[i].r = palette[(i * 3)];
  77.     allegpal[i].g = palette[(i * 3) + 1];
  78.     allegpal[i].b = palette[(i * 3) + 2];
  79.   }
  80.  
  81.   set_palette (allegpal);
  82. }
  83.